package com.avic.rong.userOrder.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Created by XinEr on 2019/7/17.
 * Describe:
 */
public class MineOrderViewPagerAdapter extends FragmentPagerAdapter {
    private ArrayList<String> titleList;
    private ArrayList<Fragment> fragmentList;
    public MineOrderViewPagerAdapter(FragmentManager fm,ArrayList<String> titleList,ArrayList<Fragment> fragmentList) {
        super(fm);
        this.titleList=titleList;
        this.fragmentList=fragmentList;
    }

    @Override
    public Fragment getItem(int i) {
//        Bundle bundle = new Bundle();
//        if (i==0){
//            bundle.putString("ORDER_TYPE","全部");
//        }else if (i==1){
//            bundle.putString("ORDER_TYPE","待付款");
//        }else if (i==2){
//            bundle.putString("ORDER_TYPE","待发货");
//        }else if (i==3){
//            bundle.putString("ORDER_TYPE","待收货");
//        }else if (i==4){
//            bundle.putString("ORDER_TYPE","交易完成");
//        }
//
//        MineOrderFragment mineOrderFragment = new MineOrderFragment();
//        mineOrderFragment.setArguments(bundle);
        return fragmentList.get(i);
    }

    @Override
    public int getCount() {
        return titleList.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return titleList.get(position);
    }
}
